package com.xtedu.examproject.service;

import com.xtedu.examproject.dao.base.PaperTemplatesDao;
import com.xtedu.examproject.dao.impl.PaperTemplatesDapImpl;
import com.xtedu.examproject.entity.paperTemplates;

import java.util.List;

public class PaperTemplatesService {
    private final PaperTemplatesDao paperTemplatesDao;
    public PaperTemplatesService(){
        paperTemplatesDao = new PaperTemplatesDapImpl();
    }
    public int insert(paperTemplates paperTemplates) throws Exception {
        return paperTemplatesDao.insert(paperTemplates);
    }
    public int update(paperTemplates paperTemplates) throws Exception {
        return paperTemplatesDao.update(paperTemplates);
    }
    public int delete(paperTemplates paperTemplates) throws Exception {
        return paperTemplatesDao.delete(paperTemplates);
    }
    public List<paperTemplates> findAll() throws Exception {
        return paperTemplatesDao.findAll();
    }
    public boolean deleteTemplateById(int TemplateId){
        return paperTemplatesDao.deleteTemplateById(TemplateId);
    }
    public boolean updatePaperTemplates(paperTemplates paperTemplates) throws Exception{
        return paperTemplatesDao.updatePaperTemplates(paperTemplates);
    }
    public paperTemplates findTemplateById(int TemplateId) throws Exception{
        return paperTemplatesDao.findTemplateById(TemplateId);
    }

    // 查询所有模板的id
    public List<Integer> findAllTemplateId() throws Exception{
        return paperTemplatesDao.findAllTemplateId();
    }


}
